#ifndef _DungeonsItem_h_
#define _DungeonsItem_h_

#include "Global.h"





class DungeonsItem
	: public cocos2d::CCNode
	, public cocos2d::extension::CCBMemberVariableAssigner
	, public cocos2d::extension::CCBSelectorResolver
	, public cocos2d::extension::CCNodeLoaderListener
{
public:
	CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(DungeonsItem, create);

	bool init();
	void onEnter();
	void onExit();
	DungeonsItem(void);
	~DungeonsItem(void);

	virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::CCObject * pTarget, cocos2d::CCString * pSelectorName);
	virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::CCObject * pTarget, cocos2d::CCString * pSelectorName);
	virtual bool onAssignCCBMemberVariable(cocos2d::CCObject * pTarget, cocos2d::CCString * pMemberVariableName, cocos2d::CCNode * pNode);
	virtual void onNodeLoaded(cocos2d::CCNode * pNode, cocos2d::extension::CCNodeLoader * pNodeLoader);

	int dungeonsID;
	int floorID;
private:
	CCLabelTTF* mName;
	CCSprite* mBg;
	CCControlButton* mGoBtn;
	void onBgClick(cocos2d::CCObject * pSender);
	void onGoBtnClick(CCObject * pSender, CCControlEvent pCCControlEvent);
public:
	void refresh();
};

#endif